#include "Camera.h"
D3DXMATRIX* Camera::getTransformMatrix() {
	D3DXMatrixIdentity(_pMatrix);
	

	D3DXMatrixAffineTransformation2D(
			_pMatrix,	
			1.0f, 
			NULL,
			0, 
			getTranslationVector2()
		);

	_pMatrix->_22 = -1.0f;
	return _pMatrix;
}

D3DXVECTOR2* Camera::getTranslationVector2() {
	_pTranslationVector2->x = -_rect->X;
	_pTranslationVector2->y = _rect->Y + 550;
	return _pTranslationVector2;
}

D3DXVECTOR2* Camera::getCenterVector2() {
	_pCenterVector2->x = 200 ;
	_pCenterVector2->y = 200 ;
	return _pCenterVector2;
}

void Camera::update()
{
	_rect->X = _target->X - 200;
	getTransformMatrix();
}